/* 数据抓取内容管理系统 - 简洁白色主题样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #FFFFFF;
    color: #1A1A1A;
    line-height: 1.5;
    overflow-x: hidden;
}

:root {
    --primary-color: #0066CC;
    --primary-dark: #0052A3;
    --primary-light: rgba(0, 102, 204, 0.1);
}

/* 全局颜色覆盖 */
.logo-icon {
    background-color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link.active::after {
    background-color: var(--primary-color) !important;
}

.search-input:focus {
    border-color: var(--primary-color) !important;
}

.footer-links a:hover {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    color: #FFFFFF !important;
}

.btn-primary:hover {
    background-color: var(--primary-dark) !important;
}

.tag-blue {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.alert-success {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
}

.page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.page-link:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.data-table tr:hover {
    background-color: var(--primary-light) !important;
}

.card:hover {
    border-color: var(--primary-color) !important;
}

/* 通用布局样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 80px 0 40px;
}

/* 导航栏样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #FFFFFF;
    z-index: 1000;
    border-bottom: 1px solid #E5E5E5;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    color: #0066CC;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-color: #0066CC;
    border-radius: 6px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 25px;
    position: relative;
}

.nav-link {
    color: #666666;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #0066CC;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0066CC;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 15px;
}

.search-input {
    background-color: #F8F8F8;
    border: 1px solid #E5E5E5;
    border-radius: 20px;
    padding: 8px 15px 8px 35px;
    color: #1A1A1A;
    width: 180px;
    transition: width 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #0066CC;
    width: 220px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
}

/* 页脚样式 */
.footer {
    background-color: #F8F8F8;
    border-top: 1px solid #E5E5E5;
    padding: 25px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    list-style: none;
}

.footer-links li {
    margin-right: 20px;
}

.footer-links a {
    color: #888888;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #0066CC;
}

.footer-copyright {
    color: #888888;
    font-size: 14px;
}

/* 卡片样式 */
.card {
    background-color: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: #0066CC;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E5E5E5;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    color: #666666;
}

/* 表格样式 */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #E5E5E5;
}

.data-table th {
    background-color: #F8F8F8;
    color: #1A1A1A;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

.data-table td {
    color: #666666;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #1A1A1A;
    font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background-color: #F8F8F8;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    padding: 10px 15px;
    color: #1A1A1A;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #0066CC;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #F8F8F8;
    color: #1A1A1A;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background-color: #E5E5E5;
    border-color: #0066CC;
    color: #0066CC;
}

.btn-primary {
    background-color: #0066CC;
    color: #FFFFFF;
    border: none;
}

.btn-primary:hover {
    background-color: #0052A3;
    color: #FFFFFF;
}

.btn-secondary {
    background-color: #0066CC;
    color: #FFFFFF;
    border: none;
}

.btn-secondary:hover {
    background-color: #0052A3;
    color: #FFFFFF;
}

.btn-danger {
    background-color: #FF3366;
    color: #FFFFFF;
    border: none;
}

.btn-danger:hover {
    background-color: #CC2952;
    color: #FFFFFF;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 30px 0;
}

.page-item {
    margin: 0 5px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #F8F8F8;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    color: #666666;
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #E5E5E5;
    border-color: #0066CC;
    color: #0066CC;
}

.page-item.active .page-link {
    background-color: #0066CC;
    color: #FFFFFF;
    border-color: #0066CC;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(0, 102, 204, 0.1);
    color: #0066CC;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.tag-blue {
    background-color: rgba(0, 102, 204, 0.1);
    color: #0066CC;
}

.tag-red {
    background-color: rgba(255, 51, 102, 0.1);
    color: #FF3366;
}

/* 提示信息样式 */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: #0052A3;
}

.alert-info {
    background-color: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.3);
    color: #0066CC;
}

.alert-warning {
    background-color: rgba(255, 153, 0, 0.1);
    border: 1px solid rgba(255, 153, 0, 0.3);
    color: #CC7A00;
}

.alert-danger {
    background-color: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: #CC2952;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 102, 204, 0.2);
    border-top-color: #0066CC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: #CCCCCC;
    margin-bottom: 20px;
}

.empty-text {
    color: #999999;
    font-size: 16px;
    margin-bottom: 20px;
}

/* 筛选条件样式 */
.filter-container {
    background-color: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #F8F8F8;
    border-bottom: 1px solid #E5E5E5;
    cursor: pointer;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: none;
    color: #666666;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.filter-toggle.collapsed {
    transform: rotate(180deg);
}

.filter-body {
    padding: 20px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.filter-body.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.filter-col {
    flex: 1;
    min-width: 200px;
    padding: 0 10px;
    margin-bottom: 15px;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #E5E5E5;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #E5E5E5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999999;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1A1A1A;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #E5E5E5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 模板编辑器样式 */
.template-editor-modal .modal-dialog {
    max-width: 1200px;
    width: 95%;
}

.template-editor-layout {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

.template-editor-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.template-editor-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.template-editor-section {
    background-color: #F8F8F8;
    border-radius: 6px;
    padding: 15px;
}

.template-editor-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 10px;
}

.template-editor-content {
    min-height: 300px;
    background-color: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    padding: 15px;
    color: #1A1A1A;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    overflow-y: auto;
}

.template-test-input {
    min-height: 150px;
    background-color: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    padding: 15px;
    color: #1A1A1A;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.template-test-result {
    min-height: 200px;
    background-color: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    padding: 15px;
    color: #1A1A1A;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
}

.template-test-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.template-test-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #CCCCCC;
}

.status-indicator.success {
    background-color: #52C41A;
}

.status-indicator.error {
    background-color: #FF4D4F;
}

.status-indicator.loading {
    background-color: #0066CC;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        color: #1A1A1A;
        font-size: 24px;
        cursor: pointer;
    }

    .template-editor-modal .modal-dialog {
        max-width: 95%;
    }

    .template-editor-layout {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 60px 0 30px;
    }

    .card {
        padding: 15px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-actions {
        margin-top: 15px;
        width: 100%;
        justify-content: flex-end;
    }

    .table-wrapper {
        margin: 0 -15px;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        margin-bottom: 15px;
        justify-content: center;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-col {
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .modal-dialog {
        width: 95%;
        max-width: none;
    }

    .template-editor-layout {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .search-input {
        width: 140px;
    }

    .search-input:focus {
        width: 170px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }

    .page-link {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .filter-header {
        padding: 12px 15px;
    }

    .filter-body {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
    }

    .template-editor-layout {
        gap: 15px;
    }

    .template-editor-content {
        min-height: 250px;
    }
}